<template>
  <div class="box">
    <el-tabs v-model="activeName">
      <el-tab-pane label="常用网站" name="first">
        <div
          class="item"
          v-for="(item, index) in list"
          :key="index"
          @click="goFn(item.url)"
        >
          <el-tooltip
            effect="dark"
            :content="item.introduce"
            placement="top-start"
            :open-delay="500"
          >
            <div class="item-one">
              <el-image :src="item.url + '/favicon.ico'">
                <div slot="error" class="image-slot">
                  <img
                    src="favicon.ico"
                    alt=""
                    style="height: 30px; width: 30px"
                  />
                </div>
              </el-image>
              <p>{{ item.name }}</p>
            </div>
          </el-tooltip>
        </div>
      </el-tab-pane>
      <el-tab-pane label="开发工具" name="first2">
        <div
          class="item"
          v-for="(item, index) in develop"
          :key="index"
          @click="goFn(item.url)"
        >
          <el-tooltip
            effect="dark"
            :content="item.introduce"
            placement="top-start"
            :open-delay="500"
          >
            <div class="item-one">
              <el-image :src="item.url + '/favicon.ico'">
                <div slot="error" class="image-slot">
                  <img
                    src="favicon.ico"
                    alt=""
                    style="height: 30px; width: 30px"
                  />
                </div>
              </el-image>
              <p>{{ item.name }}</p>
            </div>
          </el-tooltip>
        </div>
      </el-tab-pane>
      <el-tab-pane label="神奇网站" name="first1">
        <div
          class="item"
          v-for="(item, index) in easyUser"
          :key="index"
          @click="goFn(item.url)"
        >
          <el-tooltip
            effect="dark"
            :content="item.introduce"
            placement="top-start"
            :open-delay="500"
          >
            <div class="item-one">
              <el-image :src="item.url + '/favicon.ico'">
                <div slot="error" class="image-slot">
                  <img
                    src="favicon.ico"
                    alt=""
                    style="height: 30px; width: 30px"
                  />
                </div>
              </el-image>
              <p>{{ item.name }}</p>
            </div>
          </el-tooltip>
        </div>
      </el-tab-pane>
    </el-tabs>
  </div>
</template>

<script>
import { collect, easyUser, develop } from '@/data/phrase.js'
export default {
  data() {
    return {
      activeName: 'first',
      list: collect,
      easyUser: easyUser,
      develop: develop
    }
  },
  methods: {
    goFn(e) {
      window.location.href = e
    }
  }
}
</script>

<style lang="less" scoped>
@font-face {
  font-family: fontziti;
  src: url(@/font/ZiTiQuanXinYiGuanHeiTi4.0-2.ttf);
}
.box {
  padding: 5px;
  // height: 400px;
  border-radius: 5px;
  background-color: #fff;
}
.item-one {
  display: flex;
  justify-content: space-around;
  align-items: center;
}
.item {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 5px;
  padding: 5px;
  font-family: 'fontziti';
  font-size: 13px;
  height: 70px;
  width: 100px;
  // border-radius: 32px;
  background: #c6e6e8;
  border-radius: 7px;
  transition: all 0.5s;
  cursor: pointer;
  .el-image {
    margin-right: 10px;
    // margin-left: 20px;
    height: 30px;
    width: 30px;
  }
  p {
    // margin-top: 10px;
  }
}
.item:hover {
  background-color: #b0e5e9;
}
.el-tab-pane {
  display: flex;
  flex-wrap: wrap;
  overflow: hidden;
}
</style>
